package com.king.spark.rdd.transform

import org.apache.spark.{SparkConf, SparkContext}

/**
 * @Author wdl
 * @Date 2022/11/22 16:34
 */
object Spark_RDD_filter {

  def main(args: Array[String]): Unit = {


    val sparkConf = new SparkConf().setMaster("local[*]").setAppName("WordCount")

    val sparkContext: SparkContext = new SparkContext(sparkConf)

    val dataRDD = sparkContext.makeRDD(List(
      1,2,3,4
    ),1)
    val dataRDD1 = dataRDD.filter(_%2 == 0)

    dataRDD1.collect().foreach(println)
    sparkContext.stop()
  }
}
